home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d18 / vis082s.arc / MATRIX5.INC < prev    next >
Text File  |  1991-04-17  |  6KB  |  212 lines

  1. (*
  2.    The first of the User/Arrow-Key Interface by Crimson Blade
  3.    Thanks to the HavokTeam for the frame of this matrix..
  4. *)
  5.  
  6. var num_command : integer;
  7.     k           : char;
  8.     i           : integer;
  9.  
  10. function mc(le_color:byte;background:boolean):string;
  11. var s:string;
  12. begin
  13.  if le_color>7 then le_color:=le_color-8;
  14.  if le_color<=0 then le_color:=4;
  15.  case le_color of
  16.   1:s:='34m';
  17.   2:s:='32m';
  18.   3:s:='36m';
  19.   4:s:='31m';
  20.   5:s:='35m';
  21.   6:s:='33m';
  22.   7:s:='37m';
  23.  end;
  24.  if background then s[1]:=chr(ord(s[1])+1);
  25.  mc:=s;
  26. end;
  27. procedure hi_1;
  28. begin
  29.  urec.config:=urec.config+[ansigraphics];
  30.  ColorFB(5,4);
  31. end;
  32. procedure lo_1;
  33. begin
  34.  urec.config:=urec.config+[ansigraphics];
  35.  ColorFB(5,4)
  36. end;
  37. procedure hi_2;
  38. var s:string;
  39. begin
  40.  urec.config:=urec.config+[ansigraphics];
  41.  ColorFB(5,4);
  42. end;
  43. procedure lo_2;
  44. begin
  45.  urec.config:=urec.config+[ansigraphics];
  46.  ColorFB(5,4);
  47. end;
  48. procedure set_up_pulls;
  49. var b:byte;z:integer;
  50.  
  51. procedure Shadow1;
  52. Begin
  53.   ANSiCOLOR(8);
  54.   WriteLn(' █');
  55. End;
  56.  
  57. procedure wc_a(a:string;b:string);
  58. begin
  59.   urec.config:=urec.config+[ansigraphics];
  60.   colorFB(9,0);Write(a);
  61.   ColorFB(9,1);Write(b);
  62. End;
  63.  
  64. procedure wc_2(a:string;c:string;s:string;t:string);
  65. begin
  66. urec.config:=urec.config+[ansigraphics];
  67. (*hi_2*) colorfb(9,0);write(a);
  68. (*lo_1*) colorfb(3,1);write(c);
  69. (*hi_1*) write(' » ');
  70. (*lo_2*) write(s);
  71. (*hi_2*) colorfb(9,0);write(t);
  72. end;
  73. begin
  74.  urec.config:=urec.config+[ansigraphics];
  75.  ANSiCLS;
  76.  if M_Line_1<>'' then begin
  77.   ColorFb(3,1);
  78.   if length(m_line_1)>=21 then
  79.    write('') (* (m_line_1) *) else begin
  80.     b:=round((21-length(m_line_1))/2);
  81.     for z:=1 to b do write('');
  82.     write(''); (* (m_line_1); *)
  83.   end;
  84.   end else writeln;
  85.  Write(^M^M^M^M);
  86.  wc_a('                          █','▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀█'^M);
  87.  wc_a('                          █',' ViSiON Pulldowns v1.0 █');Shadow1;
  88.  wc_a('                          █','▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄█');Shadow1;ANSiCOLOR(8);
  89.  Write('                                                   ');Shadow1;
  90.  wc_a('                          █','▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀█');Shadow1;
  91.  wc_2('                          █',' 1','Logon to System   ','█');Shadow1;
  92.  wc_2('                          █',' 2','System Number 2   ','█');Shadow1;
  93.  wc_2('                          █',' 3','System Number 3   ','█');Shadow1;
  94.  wc_2('                          █',' 4','Check for Access  ','█');Shadow1;
  95.  wc_2('                          █',' 5','Apply for Access  ','█');Shadow1;
  96.  wc_2('                          █',' 6','Feedback to Sysop ','█');Shadow1;
  97.  wc_2('                          █',' 7','Chat with Sysop   ','█');Shadow1;
  98.  wc_2('                          █',' 8','Goodbye           ','█');Shadow1;
  99.  wc_a('                          █','▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄█');Shadow1;ANSiCOLOR(8);
  100.  WriteLn('                            ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄█');
  101.  ColorFB(14,0);
  102. end;
  103.  
  104. procedure write_command;
  105. begin
  106.  urec.config:=urec.config+[ansigraphics];
  107.  case num_command of
  108.   1:begin Goxy(33,10);Write('Logon to System');end;
  109.   2:begin Goxy(33,11);Write('System Number 2');end;
  110.   3:begin Goxy(33,12);Write('System Number 3');end;
  111.   4:begin Goxy(33,13);Write('Check for Access');end;
  112.   5:begin Goxy(33,14);Write('Apply for Access');end;
  113.   6:begin Goxy(33,15);Write('Feedback to Sysop');end;
  114.   7:begin Goxy(33,16);Write('Chat with Sysop');end;
  115.   8:begin Goxy(33,17);Write('Goodbye');end;
  116.  end;
  117. end;
  118.  
  119. procedure put_box;
  120. begin
  121.  urec.config:=urec.config+[ansigraphics];
  122.  write(#27+'[',(num_command+2),';5H');
  123.  Write(#27+'[0;',mc(m_col_1,true));
  124.  hi_2;
  125.  hi_2;
  126.  ColorFB(14,4);
  127.  write_command;
  128.  ColorFB(1,0);
  129. end;
  130.  
  131. procedure pop_box;
  132. begin
  133.  urec.config:=urec.config+[ansigraphics];
  134.  write(#27+'[',(num_command+2),';5H');
  135.  write(#27+'[0m');
  136.  lo_2;
  137.  ColorFb(3,1);
  138.  write_command;
  139. end;
  140.  
  141. if matrixtype = 4 then begin
  142.       set_up_pulls;
  143.       num_command:=1;
  144.       put_box;
  145.       clearbreak;
  146.       nobreak:=True;
  147.       repeat
  148.        if local then begin
  149.         repeat
  150.          k:=#255;
  151.          k:=readkey;
  152.         until k<>#255;
  153.         if k = #0 then k:=readkey;
  154.        end else
  155.        k:=waitforchar;
  156.  
  157.        if (k=#27) and not(local) then begin
  158.         Repeat
  159.          k:=waitforchar;
  160.         Until (k<>'[') Or hungupon
  161.         End;
  162.  
  163.        if k = #32 then set_up_pulls else
  164.         if k in ['1'..'6'] then
  165.          begin
  166.           i:=ord(k)-48;
  167.           if i<>num_command
  168.           then begin
  169.            pop_box;
  170.            num_command:=i;
  171.            put_box;
  172.           end;
  173.          end else if
  174.  
  175.          (k='A') or (k='D') or (k='K') or (k='H') then
  176.            begin
  177.             pop_box;
  178.             if num_command=1 then num_command:=9;
  179.             num_command:=num_command-1;
  180.             put_box;
  181.            end else if
  182.           (k='B') or (k='C') or (k='M') or (k='P') then
  183.            begin
  184.             pop_box;
  185.             if num_command=8 then num_command:=0;
  186.             num_command:=num_command+1;
  187.             put_box;
  188.          end else
  189.          if k = #13 then begin
  190.           write(#27+'[0m');
  191.           ansicls;
  192.           case num_command of
  193.            1 : system1;
  194.            2 : system2;
  195.            3 : system3;
  196.        5 : matrixnewuser;
  197.        4 : matrixcheck;
  198.        6 : matrixfeedback;
  199.        7 : matrixchat;
  200.        8 : matrixlogoff;
  201.           end;
  202.           if (PCBMover<>'IN') and (tries<=matrixinput) and not(hungupon)
  203.            then begin
  204.             set_up_pulls;
  205.             put_box;
  206.            end;
  207.           end;
  208.        Until (PCBMover='IN') Or (tries>MatrixInput) Or hungupon;
  209.        If (tries>MatrixInput) And ( PCBMover <> 'IN') Then disconnect;
  210.        If hungupon Then unum:=-999;
  211.       end;
  212.      end;